﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;

using System.Text;
using System.Windows.Forms;

namespace Pufang.Execl.BusinessCompute
{
    public partial class landing : Form
    {

        public static string UserTypeName;

        public landing()
        {
            InitializeComponent();
            txtTypeName.SelectedIndex = 1;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTypeName.Text) == true)
            {
                MessageBox.Show("账号类型不能为空");
                return;

            }
            if (string.IsNullOrEmpty(txtPassWord.Text) == true)
            {
                MessageBox.Show("账号密码不能为空");
                return;

            }

            if (txtTypeName.Text == "管理员" && txtPassWord.Text.ToLower().Trim() == "pufang520".ToLower())
            {
                this.Hide();
                UserTypeName = "管理员";
                new FormMain().Show();
                return;
            }
            if (txtTypeName.Text == "普通用户" && txtPassWord.Text.ToLower().Trim() == "12345".ToLower())
            {
                UserTypeName = "普通用户";
                this.Hide();
                new FormMain().Show();
                return;
            }

            MessageBox.Show("密码错误！");
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();

        }
    }
}
